#!/usr/bin/env python
PACKAGE = "mrs_octomap_tools"

import roslib;
roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

actions = gen.add_group("Actions");

actions.add("action_set_unknown", bool_t, 0, "set uknown", False)
actions.add("action_set_free", bool_t, 0, "set free", False)
actions.add("action_remove_free", bool_t, 0, "remove free", False)
actions.add("action_set_unknown_to_free", bool_t, 0, "set unknown to free", False)
actions.add("action_set_occupied", bool_t, 0, "set occupied", False)
actions.add("action_clear_outside", bool_t, 0, "clear outside bbx", False)
actions.add("action_dilate", bool_t, 0, "dilate inside bbx", False)
actions.add("action_erode", bool_t, 0, "dilate inside bbx", False)
actions.add("action_copy", bool_t, 0, "copy", False)
actions.add("action_clear", bool_t, 0, "clear", False)
actions.add("action_remove_ceiling", bool_t, 0, "remove ceiling", False)

free_above_ground = gen.add_group("Set free above ground");

free_above_ground.add("action_set_free_above_ground", bool_t, 0, "set free above ground", False)
free_above_ground.add("free_above_ground_height", double_t, 0, "Free above ground height", 0.0, 1.0, 100.0)

translate = gen.add_group("Translate map");

translate.add("translate_x", double_t, 0, "Translate by X", 0.0, -1000.0, 1000.0)
translate.add("translate_y", double_t, 0, "Translate by Y", 0.0, -1000.0, 1000.0)
translate.add("translate_z", double_t, 0, "Translate by Y", 0.0, -1000.0, 1000.0)
translate.add("action_translate", bool_t, 0, "Translate map", False)

translate = gen.add_group("Refractor");

translate.add("fractor", int_t, 0, "New fractor", 0, -5, 5)
translate.add("action_refractor", bool_t, 0, "Refractor", False)

translate = gen.add_group("Filter specs");

translate.add("spec_size", int_t, 0, "Spec size", 0, 0, 100)
translate.add("action_filter_specs", bool_t, 0, "Filter specs", False)

movement = gen.add_group("ROI Movement");

movement.add("roi_move_step", double_t, 0, "Step", 0.0, -100.0, 100.0)

movement.add("roi_move_plus_x", bool_t, 0, "Move ROI in +x", False)
movement.add("roi_move_minus_x", bool_t, 0, "Move ROI in -x", False)

movement.add("roi_move_plus_y", bool_t, 0, "Move ROI in +y", False)
movement.add("roi_move_minus_y", bool_t, 0, "Move ROI in -y", False)

movement.add("roi_move_plus_z", bool_t, 0, "Move ROI in +y", False)
movement.add("roi_move_minus_z", bool_t, 0, "Move ROI in -y", False)

resize = gen.add_group("ROI Resizement");

resize.add("roi_resize_step", double_t, 1, "Step", 0.0, -100.0, 100.0)

resize.add("roi_resize_plus_x", bool_t, 0, "Resize ROI in +x", False)
resize.add("roi_resize_minus_x", bool_t, 0, "Resize ROI in -x", False)

resize.add("roi_resize_plus_y", bool_t, 0, "Resize ROI in +y", False)
resize.add("roi_resize_minus_y", bool_t, 0, "Resize ROI in -y", False)

resize.add("roi_resize_plus_z", bool_t, 0, "Resize ROI in +y", False)
resize.add("roi_resize_minus_z", bool_t, 0, "Resize ROI in -y", False)

roi = gen.add_group("Region Of Interest");

roi.add("roi_fit_to_map", bool_t, 2, "fit to map", False)

roi.add("roi_x", double_t, 0, "Center-x", 0.0, -1000.0, 1000.0)
roi.add("roi_y", double_t, 0, "Center-y", 0.0, -1000.0, 1000.0)
roi.add("roi_z", double_t, 0, "Center-z", 0.0, -1000.0, 1000.0)

roi.add("roi_width", double_t, 0, "Width", 0.0, 1.0, 1000.0)
roi.add("roi_depth", double_t, 0, "Depth", 0.0, 1.0, 1000.0)
roi.add("roi_height", double_t, 0, "Height", 0.0, 1.0, 100.0)

map = gen.add_group("Map");

map.add("map_name", str_t, 0, "map name", "")

map.add("action_load", bool_t, 0, "Load map", False)
map.add("action_save", bool_t, 0, "Save map", False)
map.add("prune", bool_t, 0, "Prune", False)
map.add("expand", bool_t, 0, "Expand", False)
map.add("prune_in_roi", bool_t, 0, "Prune in roi", False)
map.add("expand_in_roi", bool_t, 0, "Expand in roi", False)

map.add("undo", bool_t, 0, "Undo", False)

map.add("resolution", double_t, 1, "Resolution", 0.0, 0.01, 100.0)

exit(gen.generate(PACKAGE, "OctomapEditor", "octomap_editor"))
